﻿// LightNet - Lightweight .NET Framework
// Copyright (c) 2010 http://lightnet.codeplex.com

namespace System.Runtime.InteropServices
{
    /// <summary>
    /// Indicates the type of class interface to be generated for a class exposed to COM, if an interface is generated at all.
    /// </summary>
    [AttributeUsage(AttributeTargets.Class | AttributeTargets.Assembly, Inherited = false)]
    public sealed class ClassInterfaceAttribute : Attribute
    {
        public ClassInterfaceType Value { get; private set; }

        /// <summary>
        /// Initializes a new instance of the <see cref="T:System.Runtime.InteropServices.ClassInterfaceAttribute" /> class with the specified <see cref="T:System.Runtime.InteropServices.ClassInterfaceType" /> enumeration value.
        /// </summary>
        /// <param name="classInterfaceType">Describes the type of interface that is generated for a class.</param>
        public ClassInterfaceAttribute(short classInterfaceType)
        {
            Value = (ClassInterfaceType)classInterfaceType;
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="T:System.Runtime.InteropServices.ClassInterfaceAttribute" /> class with the specified <see cref="T:System.Runtime.InteropServices.ClassInterfaceType" /> enumeration member.
        /// </summary>
        /// <param name="classInterfaceType">One of the <see cref="T:System.Runtime.InteropServices.ClassInterfaceType" /> values that describes the type of interface that is generated for a class.</param>
        public ClassInterfaceAttribute(ClassInterfaceType classInterfaceType)
        {
            Value = classInterfaceType;
        }
    }
}
